let upload = document.getElementById("upload")

upload.onmouseover = function () {
    upload.style.opacity = "10%"
}

upload.onmouseleave = function (){
    upload.style.opacity = "0%"
}

let submit = document.getElementById("submit")
submit.onmouseover = function () {
    submit.style.backgroundColor = "#09b2fc"
}

submit.onmouseleave = function (){
    submit.style.backgroundColor = "#6e8cd7"
}


let fileName = document.getElementById("fileName")
function showFileName() {

    //upload.value获取上传文件的全路径名称，之后从倒数的一个\开始截取，剩下的部分为：\文件名.扩展名
    //继续使用substring舍弃的一个字符，剩下的为 "文件名.扩展名"

    fileName.innerText = upload.value.substring(upload.value.lastIndexOf("\\"),upload.value.size).substring(1)
}
